from django.http.response import HttpResponse
from django.utils.deprecation import MiddlewareMixin


class MyMiddleware(MiddlewareMixin):

    def process_request(self, request):
        print('我是第一个中间件了的process_request的方法')

    def process_response(self, request, response):
        print('第一个response:', response)
        return response


class MyMiddleware2(MiddlewareMixin):

    def process_request(self, request):
        print('我是第二个中间件了的process_request的方法')

    def process_response(self, request, response):
        print('第二个response:', response)
        return response